/*
 * @Description:
 * @Author: CcSimple
 * @Github: https://github.com/CcSimple
 * @Date: 2023-02-09 10:40:26
 * @LastEditors: CcSimple
 * @LastEditTime: 2023-02-09 11:37:21
 */
import {
  hiprint
} from "vue-plugin-hiprint";
export const provider1 = function(options) {
  console.log(options);
  var addElementTypes = function(context) {
    context.removePrintElementTypes("providerModule1");
    context.addPrintElementTypes("providerModule1", [
      new hiprint.PrintElementTypeGroup("常规", [
        options.config,
        {
          tid: "providerModule1.header",
          title: "四川普锐特药业有限公司",
          data: "四川普锐特药业有限公司",
          type: "text",
          options: {
            testData: "四川普锐特药业有限公司",
            height: 17,
            fontSize: 16.5,
            fontWeight: "700",
            textAlign: "center",
            hideTitle: true,
          },
        },
        {
          tid: "providerModule1.common",
          title: "通用",
          data: "",
          type: "text",
          options: {
            hideTitle: true,
            fields: [{
              text: "物料代码",
              field: "graphid"
            }, {
              text: "物料名称",
              field: "skuName"
            }, {
              text: "自定义物料批号",
              field: "vbatchCode"
            }, {
              text: "有效期",
              field: "expirationDate"
            }, {
              text: "复验期",
              field: "resetDate"
            }, {
              text: "容器号",
              field: "sortNum"
            }],
            testData: "",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.ghdw",
          title: "购货单位",
          data: "重药控股(海南)医药有限公司",
          type: "text",
          options: {
            field: "ghdw",
            testData: "重药控股(海南)医药有限公司",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.address",
          title: "收货地址",
          data: "陕西省西安市雁塔区",
          type: "text",
          options: {
            field: "address",
            testData: "陕西省西安市雁塔区",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.people",
          title: "收货人",
          data: "",
          type: "text",
          options: {
            testData: "",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.phone",
          title: "收货电话",
          data: "158965854512",
          type: "text",
          options: {
            field: "phone",
            testData: "158965854512",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.xiaoshoudate",
          title: "销售日期",
          data: "2024-1-1",
          type: "text",
          options: {
            field: "xiaoshoudate",
            testData: "2024-1-1",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.chukudate",
          title: "出库日期",
          data: "2024-1-1",
          type: "text",
          options: {
            field: "chukudate",
            testData: "2024-1-1",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.fahuodate",
          title: "发货日期",
          data: "2024-1-1",
          type: "text",
          options: {
            field: "fahuodate",
            testData: "2024-1-1",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.yunshufangshi",
          title: "运输方式",
          data: "汽运",
          type: "text",
          options: {
            field: "yunshufangshi",
            testData: "汽运",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.produceqy",
          title: "生产企业",
          data: "四川普锐特药业有限公司",
          type: "text",
          options: {
            field: "produceqy",
            testData: "四川普锐特药业有限公司",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.address2",
          title: "地址",
          data: "四川省成都高新区安五路566号",
          type: "text",
          options: {
            field: "address2",
            testData: "四川省成都高新区安五路566号",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.creator",
          title: "制单人",
          data: "张三",
          type: "text",
          options: {
            field: "creator",
            testData: "张三",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.money",
          title: "财务部",
          data: "李四",
          type: "text",
          options: {
            field: "money",
            testData: "李四",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.kufang",
          title: "仓储专员",
          data: "仓储专员",
          type: "text",
          options: {
            field: "kufang",
            testData: "仓储专员",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.order",
          title: "发货单号",
          data: "XS888888888",
          type: "text",
          options: {
            field: "order",
            testData: "XS888888888",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.barcode",
          title: "条形码",
          data: "XS888888888",
          type: "text",
          options: {
            field: "barcode",
            testData: "XS888888888",
            height: 32,
            fontSize: 12,
            lineHeight: 18,
            textAlign: "left",
            textType: "barcode",
          },
        },
        {
          tid: 'providerModule1.qrcode',
          title: '二维码',
          type: 'qrcode',
          options: {
            field: "qrcode",
          },
        }, {
          tid: "providerModule1.image",
          title: "Logo",
          data: "",
          type: "image",
          options: {
            field: "image",
            src: "https://foruda.gitee.com/avatar/1677050350324030848/5400665_ccsimple_1591166830.png!avatar200",
          },
        },
      ]),
      new hiprint.PrintElementTypeGroup("客户", [{
          tid: "providerModule1.khname",
          title: "客户名称",
          data: "高级客户",
          type: "text",
          options: {
            field: "name",
            testData: "高级客户",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.tel",
          title: "客户电话",
          data: "",
          type: "text",
          options: {
            field: "tel",
            testData: "18888888888",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
      ]),
    ]);
  };
  return {
    addElementTypes: addElementTypes,
  };
};
